/**
 * @file sys_monitor.c
 * @author your name (you@domain.com)
 * @brief
 * @version 0.1
 * @date 2025-01-08
 *
 * @copyright Copyright (c) 2025
 *
 */

/* includes ----------------------------------------------------------*/
#include "sys_monitor.h"
#include "dal_led.h"
#include "semphr.h"
#include "dal_dem.h"
/* typedef -----------------------------------------------------------*/
/* define ------------------------------------------------------------*/
/* variables ---------------------------------------------------------*/
// 任务句柄
TaskHandle_t             SysMonitorTask_Handler;
extern SemaphoreHandle_t MutexSemaphore; /* 互斥信号量 */
/* function prototypes -----------------------------------------------*/

/**
 * @brief 创建系统监控线程
 *
 * @param pvParameters
 */
void system_monitor_task(void* pvParameters)
{
    while (1) {
        xSemaphoreTake(MutexSemaphore, portMAX_DELAY);
        vdal_dem_handle();
        vdal_led_ctrl(TASK_LED, ENABLE);
        vTaskDelay(400);
        vdal_led_ctrl(TASK_LED, DISABLE);
        vTaskDelay(400);
        xSemaphoreGive(MutexSemaphore);
    }
}
